<template>
  <div class="box">
    <div class="box-con">
      <div class="fen-leftw">
        <div class="fenleikk">
          <h3 style="margin-left: 30px">分类</h3>
          <div
            class="fenleii"
            @click="Fenxiang(item.id)"
            v-for="(item, index) in csshu"
            :key="index"
          >
            <div class="fen-conq">
              <i class="el-icon-folder-opened"></i>
              {{ item.name }}
            </div>
          </div>
        </div>
      </div>
      <div class="right">
        <div class="right-tou">
          <img :src="cxk.avatar" alt="" />
          <h3>{{ cxk.author }}</h3>
          <p>{{ cxk.introduction }}</p>
        </div>
      </div>
    </div>
    <div class="box-xia">
      <div class="box-xia-com">
        <div>
          © 2023
          <span>Weblog™.</span>
          All Rights Reserved.
        </div>
        <div>Provided by <span>犬小哈</span></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      csshu: [],
      cxk: {},
    };
  },
  created() {
    this.getFen();
    this.getAdd();
  },
  methods: {
    Fenxiang(id) {
      this.$router.push({
        path: "/home/fenxiang",
        query: { categoryId: String(id) },
      });
    },
    async getAdd() {
      let res = await this.$axios.post(
        "http://47.104.167.34:9110/api/blog/setting/detail"
      );
      // console.log(res);
      this.cxk = res.data.data;
    },
    async getFen() {
      let res = await this.$axios.post(
        "http://47.104.167.34:9110/api/category/list"
      );
      // console.log(res);
      this.csshu = res.data.data;
    },
  },
};
</script>

<style scoped>
@import "./fenlei.css";
</style>